import { CategoryService } from './category.service';
import { Autowire } from 'ts-express-restful';
import { ArticleService } from './article.service';
import { WebsiteService } from './website.service';
class CacheMgr {
    @Autowire
    public articleService!: ArticleService;
    @Autowire
    public categoryService!: CategoryService;
    @Autowire
    public websiteService!: WebsiteService;

    async removeCache() {
        return Promise.all([
            this.articleService.$storage.removeAll(),
            this.categoryService.$storage.removeAll(),
            this.websiteService.$storage.removeAll()
        ])
    }
}

const cacheMgr = new CacheMgr();
export async function cacheRemoveAll(): Promise<any> { 
    return cacheMgr.removeCache();
}

